DROP TABLE IF EXISTS jms_dm.dm_traffic_flow_network_dt ;
CREATE EXTERNAL TABLE jms_dm.dm_traffic_flow_network_dt(
      inputtime date COMMENT '日期',
      count_type bigint COMMENT '数据类型',
      send_network_code string COMMENT '始发网点code',
      receiver_network_code string COMMENT '签收网点code',
      send_regional_id string COMMENT '始发大区id',
      send_regional string COMMENT '始发大区name',
      send_agent_code string COMMENT '始发代理区code',
      send_agent string COMMENT '始发代理区name',
      send_fran_code string COMMENT '始发加盟商code',
      send_fran string COMMENT '始发加盟商name',
      send_province_id string COMMENT '始发省份id',
      send_province string COMMENT '始发省份name',
      send_city_id string COMMENT '始发城市id',
      send_city string COMMENT '始发城市name',
      send_area_id string COMMENT '始发区id',
      send_area string COMMENT '始发区name',
      send_distributecode string COMMENT '始发转运中心code',
      send_distribute string COMMENT '始发转运中心name',
      send_network string COMMENT '始发网点name',
      receiver_network string COMMENT '签收网点name',
      receiver_agent_code string COMMENT '签收代理区code',
      receiver_agent string COMMENT '签收代理区name',
      receiver_fran_code string COMMENT '签收加盟商code',
      receiver_fran string COMMENT '签收加盟商name',
      receiver_regional_id string COMMENT '签收大区id',
      receiver_regional string COMMENT '签收大区name',
      receiver_province_id string COMMENT '签收省份id',
      receiver_province string COMMENT '签收省份name',
      receiver_city_id string COMMENT '签收城市id',
      receiver_city string COMMENT '签收城市name',
      receiver_distributecode string COMMENT '目的转运中心code',
      receiver_distribute string COMMENT '目的转运中心name',
      receiver_area_id string COMMENT '签收区id',
      receiver_area string COMMENT '签收区name',
      package_number bigint COMMENT '正向件数',
      package_total_weight decimal(12,2) COMMENT '正向重量',
      package_total_volume decimal(12,2) COMMENT '正向体积',
      f_package_number bigint COMMENT '反向件数',
      f_package_total_weight decimal(12,2) COMMENT '反向重量',
      f_package_total_volume decimal(12,2) COMMENT '反向体积')
COMMENT '流量流向网点-网点汇总表'
PARTITIONED BY (
  dt string COMMENT '时间分区(yyyyMMdd)')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_traffic_flow_network_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_dm.dm_traffic_flow_network_dt;
